<div class="content">
  <h1 mat-dialog-title class="title">添加论坛</h1>
  <form  #editorForm="ngForm">
    <div mat-dialog-content class="editor-form">
      <mat-form-field appearance="standard">
        <mat-label>文章标题</mat-label>
        <input matInput required [(ngModel)]="forum.title" name="forumTitle">
        <mat-error *ngIf="messages.forumTitle">{{ messages.forumTitle }}</mat-error>
      </mat-form-field>

      <div appearance="standard">
        <mat-label>文章内容</mat-label>
        <div [froalaEditor]="options" [(froalaModel)]="content"></div>
      </div>

      <!--<mat-form-field appearance="standard">-->
        <!--<mat-label>文章类型</mat-label>-->
        <!--<mat-select placeholder="文章类型" [(value)]="forum.type">-->
          <!--<mat-option *ngFor="let category of categorys" [value]="category.typeId">-->
            <!--{{category.newsName}}-->
          <!--</mat-option>-->
        <!--</mat-select>-->
        <!--<mat-error *ngIf="false"></mat-error>-->
      <!--</mat-form-field>-->

      <mat-form-field>
        <mat-label>文章类型</mat-label>
        <mat-select placeholder="文章类型" [(value)]="forum.type">
          <mat-optgroup *ngFor="let category of categorys" [label]="category.newsName">
            <mat-option *ngFor="let item of category.child" [value]="item.sjtypeId">
              {{ item.newsName }}
            </mat-option>
          </mat-optgroup>
        </mat-select>
      </mat-form-field>
      <br>
      <mat-form-field appearance="standard">
        <mat-label>作者</mat-label>
        <input matInput [(ngModel)]="forum.author" name="forumAuthor">
        <mat-error *ngIf="messages.forumAuthor">{{ messages.forumAuthor }}</mat-error>
      </mat-form-field>

    </div>
    <div mat-dialog-actions class="buttons">
      <button mat-button (click)="onSubmit()">确认</button>
      <button mat-button [mat-dialog-close] cdkFocusInitial>取消</button>
    </div>
  </form>
</div>


